﻿<Controls:DialogChrome x:Class="MTGenome.Views.QuestionDialogView"
                       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                       xmlns:Controls="clr-namespace:Caliburn.ShellFramework.Controls;assembly=Caliburn.ShellFramework"
                       xmlns:caliburn="http://www.caliburnproject.org"
                       Width="400" Height="200" AllowsTransparency="True" Background="Transparent" ShowInTaskbar="False"
                       Title="{Binding DisplayName, Mode=TwoWay}" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterOwner"
                       Buttons="{Binding Buttons}" Style="{StaticResource {x:Type Controls:DialogChrome}}">
    <Grid>
        <TextBlock x:Name="FirstQuestion_Text"
                   Grid.Row="0"
                   Margin="2 4 0 6"
                   TextWrapping="Wrap" 
                   Foreground="Black"
                   Visibility="{Binding HasOneQuestion, Converter={StaticResource {x:Type BooleanToVisibilityConverter}}}"/>

        <ScrollViewer BorderThickness="0"
                      VerticalScrollBarVisibility="Auto"
                      Visibility="{Binding HasMultipleQuestions, Converter={StaticResource {x:Type BooleanToVisibilityConverter}}}">
            <ItemsControl x:Name="Questions"
                          Margin="0 2 0 4">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Border BorderBrush="#5fff"
                                BorderThickness="0 0 0 1"
                                Padding="2"
                                Margin="0 1 0 1">
                            <StackPanel>
                                <TextBlock Text="{Binding Text}" 
                                           Foreground="Black"/>
                                <ComboBox HorizontalAlignment="Right"
                                          ItemsSource="{Binding PossibleAnswers}"
                                          SelectedItem="{Binding Answer, Converter={StaticResource {x:Type caliburn:EnumConverter}}, Mode=TwoWay}" />
                            </StackPanel>
                        </Border>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</Controls:DialogChrome>